package cn.gson.boot.model.dao;

import cn.gson.boot.model.pojos.Tuihuoxiangqing;
import cn.gson.boot.model.pojos.Wxgdtuihuan;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;

import javax.transaction.Transactional;
import java.sql.Timestamp;

public interface WxgdTuiHuanDao extends CrudRepository<Wxgdtuihuan,Integer> {
    //修改维修退换货的维修完成状态
    @Transactional
    @Modifying(clearAutomatically = true)
    @Query(nativeQuery = true,value = "update wxgdtuihuan set gd2_wx=?1 where gd2_id=?2")
    public void updatewxtuihuanWcZtai(Integer gd2Wx,Integer gd2Id);
    //修改维修退换货的维修完成时间
    @Transactional
    @Modifying(clearAutomatically = true)
    @Query(nativeQuery = true,value = "update wxgdtuihuan set gd2_wctime=?1 where gd2_id=?2")
    public void updatewxtuihuanWcTime(Timestamp gd2Wctime, Integer gd2Id);


    //修改维修退换货的入库状态
    @Transactional
    @Modifying(clearAutomatically = true)
    @Query(nativeQuery = true,value = "update wxgdtuihuan set gd2_rk=?1 where gd2_id=?2")
    public void updatewxtuihuanRuKuZtai(Integer gd2Rk,Integer gd2Id);
    //修改维修退换货的状态
    @Transactional
    @Modifying(clearAutomatically = true)
    @Query(nativeQuery = true,value = "update wxgdtuihuan set gd2_zhuangtai=?1 where gd2_id=?2")
    public void updatewxtuihuanZhuangTai(String gd2ZhuangTai,Integer gd2Id);
}
